// 路由配置数组
export const routes = [
  {
    path: '/test',
    component: () => import('@/views/test/index.vue'),
    meta: {
      // 配置当前页面的标题，动态切换会使用
      title: '测试'
    }
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录'
    }
  },
  {
    path: '/user/patient',
    component: () => import('@/views/user/PatientInfo.vue'),
    meta: { title: '家庭档案' }
  },
  {
    path: '/consult/fast',
    component: () => import('@/views/consult/ConsultFast.vue'),
    meta: { title: '极速问诊' }
  },
  {
    path: '/consult/dep',
    component: () => import('@/views/consult/ConsultDep.vue'),
    meta: { title: '选择科室' }
  },
  {
    path: '/consult/illness',
    component: () => import('@/views/consult/ConsultIllness.vue'),
    meta: { title: '病情描述' }
  },
  {
    path: '/consult/pay',
    component: () => import('@/views/consult/ConsultPay.vue'),
    meta: { title: '问诊支付' }
  },
  {
    path: '/room',
    component: () => import('@/views/room/index.vue'),
    meta: { title: '问诊室' }
  },
  {
    path: '/user/consult',
    component: () => import('@/views/user/ConsultOrder.vue'),
    meta: { title: '问诊记录' }
  },
  {
    path: '/user/consult/:id',
    component: () => import('@/views/user/ConsultDetail.vue'),
    meta: { title: '问诊详情' }
  },
  {
    path: '/medicine/pay',
    component: () => import('@/views/medicine/OrderPay.vue'),
    meta: { title: '药品支付' }
  },
  {
    path: '/medicine/pay/result',
    component: () => import('@/views/medicine/OrderPayResult.vue'),
    meta: { title: '药品支付结果' }
  },
  {
    path: '/medicine/detail',
    component: () => import('@/views/medicine/OrderDetail.vue'),
    meta: { title: '药品订单详情' }
  },
  {
    path: '/medicine/express/:id', // 动态路由=>语法：path/:参数名1/:参数名2
    component: () => import('@/views/medicine/OrderExpress.vue'),
    meta: { title: '物流详情' }
  },
  // tabBar路由
  {
    path: '/',
    component: () => import('@/views/layout/index.vue'),
    redirect: '/home', // 默认重定向跳转到/home子路由
    children: [
      // 子路由=》需要在父路由的组件里边放router-view
      // 第一个子页面
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页'
        }
      },
      {
        path: '/article',
        component: () => import('@/views/article/index.vue'),
        meta: {
          title: '健康百科'
        }
      },
      {
        path: '/notify',
        component: () => import('@/views/notify/index.vue'),
        meta: {
          title: '消息通知'
        }
      },
      {
        path: '/user',
        component: () => import('@/views/user/index.vue'),
        meta: {
          title: '个人中心'
        }
      }
    ]
  }
]
